package com.i2863.receiptinterface.service.impl;

import com.i2863.receiptinterface.entity.Site;
import com.i2863.receiptinterface.mapper.SiteMapper;
import com.i2863.receiptinterface.service.SiteService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SiteServiceImpl implements SiteService {

    @Resource
    private SiteMapper siteMapper;

    @Override
    public List<Site> findAll() {
        return siteMapper.selectAll();
    }

    @Override
    public void update(Site site) {
        siteMapper.updateByPrimaryKey(site);
    }

    @Override
    public void delete(Integer Id) {
        siteMapper.deleteByPrimaryKey(Id);
    }

    @Override
    public Site findOne(Integer id) {
        return siteMapper.selectByPrimaryKey(id);
    }

    @Override
    public void add(Site site) {
        siteMapper.insert(site);
    }
}
